package com.song.dao;

import com.song.pojo.Employee;
import com.song.vo.EmployeeVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author 宋超
 * HP - the login name of the current user.
 * 2020/12/5 - the current system date.
 * 16:59 - the current system time.
 */

public interface EmployeeMapper {

    //根据登录账号查询员工信息
    Employee findEmployeeByLoginName(String loginName);


    //根据部门编号查询员工数量
    int getEmployeeCountById(Integer deptId);


    //根据角色编号查询员工数量
    int getEmployeeCountByRoleId(Integer roleId);


    //查询员工列表
    List<Employee>  findEmployeeList(EmployeeVo employeeVo);

    //添加员工
    int addEmployee(Employee employee);

    //修改员工
    int updateEmployee(Employee employee);

    //删除员工
    int deleteById(Integer id);

    //删除员工角色关系数据
    void deleteEmployeeAndRole(Integer id);


    //保存角色与与员工之间的关系
    void addEmployeeRole(@Param("rid") String rid, @Param("eid") Integer empId);
}
